﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore;
using PMS.Domain.AggregatesModel.ProjectAggregate;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace PMS.Infrastructure.EntityConfigurations
{
    public class ProjectConsumableEntityConfiguration : IEntityTypeConfiguration<ProjectConsumable>
    {
        public void Configure(EntityTypeBuilder<ProjectConsumable> builder)
        {
            builder.ToTable("ProjectConsumable");
            builder.HasKey(o => o.Id);
            builder.Property(b => b.Name).HasMaxLength(120).IsRequired();
            builder.Property(b => b.Specification).HasMaxLength(120).IsRequired();
            builder.Property(b => b.RequiredNumber).IsRequired();
            builder.Property(b => b.Provider).HasMaxLength(120).IsRequired();

        }
    }
}
